<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
<?php Yii::app()->clientScript->registerCssFile('css/style.css'); ?>
</head>
<body>
	<?php
	$this->widget('bootstrap.widgets.TbNavbar', array(
		'type' => 'inverse',
		'items' => array(
			array(
				'class' => 'bootstrap.widgets.TbMenu',
				'items' => array(
					'|',
					array('label' => '后台首页', 'icon' => 'home white', 'url' => array('site/index')),
					array('label' => '项目列表', 'icon' => 'list white', 'url' => array('project/index')),
					array('label' => '用户&权限', 'icon' => 'user white', 'url' => array('user/index'), 'visible' => Yii::app()->user->isAdmin),
				)
			),
			array(
				'class' => 'bootstrap.widgets.TbMenu',
				'activeCssClass' => '',
				'htmlOptions' => array('class' => 'pull-right'),
				'items' => array(
					array(
						'label' => Yii::app()->user->name,
						'icon' => 'user white',
						'visible' => !Yii::app()->user->isGuest,
						'items' => array(
							array('label' => '选项设置', 'icon' => 'cog', 'url' => array('user/profile')),
							'---',
							array('label' => '退出', 'icon' => 'off', 'url' => array('/site/logout'))
						),
					),
				),
			),
		),
	));
	?>
	<div id="main" class="container">
		<div class="row-fluid">
			<div class="span2">
				<?php $this->widget($this->projectName === null ? 'ProjectListWidget' : 'ProjectMenuWidget'); ?>
			</div>
			<div class="span10">
				<?php $this->widget('bootstrap.widgets.TbBreadcrumbs', array('links' => $this->breadcrumbs)); ?>
				<?php echo $content; ?>
			</div>
		</div>
	</div>
	<div class="clearfix"></div>
	<footer>
		<div class="text-center muted">
			&copy; 2011-<?php echo date('Y'); ?> 
			<?php echo Yii::app()->name; ?>/<?php echo Yii::app()->params['version']; ?>
			<br />
			Powered by <a href="http://www.xunsearch.com" target="_blank"><img id="footer-logo" src="<?php echo Yii::app()->request->baseUrl; ?>/img/logo.png" alt="xunsearch" height="32" width="48" /></a>
		</div>
	</footer>
</body>
</html>
